import React, { Component } from "react";

export default class Item extends Component {
  render() {
    let { todo, chooseItem, deleteItem } = this.props;
    return (
      <li>
        <label>
          <input
            type="checkbox"
            checked={todo.done}
            onChange={() => chooseItem(todo.id)}
          />
          <span>{todo.title}</span>
        </label>
        <button className="btn btn-danger" onClick={() => deleteItem(todo.id)}>
          删除
        </button>
      </li>
    );
  }
}
